package com.zmc.lostfound.system.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

/**
 * @author zmc
 * @description 自定义线程池的配置参数
 */
@Component
@ConfigurationProperties("lostfound.thread.pool")
@Data
public class ThreadPoolConfigProperties {

    /**
     * 核心线程数
     */
    private Integer corePoolSize = 10;

    /**
     * 最大线程数
     */
    private Integer maximumPoolSize = 100;

    /**
     * 线程存活时间
     */
    private Long keepAliveTime = 30L;

    /**
     * 时间单位
     */
    private TimeUnit timeUnit = TimeUnit.SECONDS;

    /**
     * 阻塞队列长度
     */
    private Integer workQueueLength = 500;

    /**
     * 核心线程是否空闲超时自动销毁
     */
    private Boolean allowCoreThreadTimeOut = false;

}
